<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <link rel="shortcut icon" href="../static/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="../static/css/reset.css" />
    <link rel="stylesheet" type="text/css" href="../static/css/login.css" />
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script>
        $(function () {
            $('.loginbtn').on('click', () => {
                $.ajax({
                    url: '/login',
                    type: 'post',
                    data: {
                        username: $('#username').val(),
                        password: $('#password').val()
                    },
                    success(res) {
                        if (res == '登录成功') {
                            alert('登录成功')
                            $('.tips').html('')
                        } else {
                            $('.tips').html(res)
                        }
                    }
                })
            })
        })
    </script>
</head>

<body>
    <div class="pos">
        <div class="login">
            <span class="close iconfont icon-close"></span>
            <img src="../static/img/login/loginlogo.png" alt="">
            <ul>
                <li></li>
                <li class="phone">使用手机号登陆</li>
                <li></li>
            </ul>
            <form action="/login" id="form" method="POST">
                <input style="margin-top: 0;" type="text" name="username" class="tel" id="username"
                    placeholder="请输入您的手机号">
                <input type="password" name="password" class="pass" id="password" placeholder="请输入密码">
                <span class="tips"><%= tips %></span>
                <button class="loginbtn">
                    登陆
                </button>
            </form>
            <p>
                <span>
                    还没有账号?
                    <a href="javascript:;">点击注册</a>
                </span>
            </p>
        </div>
    </div>
    <!-- <script src="../static/utils/utils.js"></script> -->
</body>

</html>